package com.chinacoal.microservice.impl.controller;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.RestController;

import com.chinacoal.microservice.api.RestSysClient;
import com.chinacoal.microservice.impl.service.ApproverService;
import com.chinacoal.microservice.util.result.CodeMsg;
import com.chinacoal.microservice.util.result.Result;

import lombok.extern.slf4j.Slf4j;

/**  
 * @Package: com.chinacoal.microservice.impl.controller.RestSysController
 * @ClassName: RestSysController
 * @ClassDesc: 外部系统调用Controller
 * @Createby: sunh
 * @CreatedDate: 2019-12-02 10:20:14
 */  
@Slf4j
@RestController
public class RestSysController implements RestSysClient{

	@Resource
	private ApproverService approverService;
	
	@Override
	public Result<List<Map<String, String>>> getApprover(Map<String, String> param) {

		try {
			log.info("1、----------------获取审批人步骤开始--------------");
			log.info("2、----------------参数：【" + param.toString() + "】");
			List<Map<String, String>> approverList = approverService.getApprover(param);
			log.info("1、----------------获取审批人步骤结束--------------");
			return Result.success(approverList);
		} catch (Exception e) {
			e.printStackTrace();
			return Result.error(CodeMsg.EXECUTE_ERROR.fillArgs(e.getMessage()));
		}
	}

}
